package com.daxue.configtest;

import org.jooq.codegen.DefaultGeneratorStrategy;
import org.jooq.meta.Definition;
import org.springframework.util.StringUtils;

/**
 * @author daxue0929
 * @date 2023/3/11
 */

public class CamelCaseNamingStrategy extends DefaultGeneratorStrategy {

    @Override
    public String getJavaClassName(Definition definition, Mode mode) {
        StringBuffer result = new StringBuffer();
        result.append(StringUtils.capitalize(definition.getOutputName()));
        if (mode == Mode.RECORD) {
            result.append("Record");
        }else if (mode == Mode.DAO) {
            result.append("DAO");
        }
        return result.toString();
    }
}
